package com.jing.cloud.service;


import com.alibaba.fastjson.JSON;
import com.jing.cloud.service.Rsp;

public class Res {
    private int code;
    private String msg;
    private Object data;


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Rsp toRsp() {
        Rsp rsp = new Rsp();
        rsp.setCode(code);
        rsp.setMsg(msg);
        if (null != data) {
            rsp.setResult(JSON.toJSONString(data));
        }
        return rsp;
    }
}
